package com.mxx.common.websecurity;

import org.springframework.security.authentication.AuthenticationDetailsSource;
import org.springframework.security.web.authentication.WebAuthenticationDetails;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

/**
 * @Auther: Mr. Zeng
 * @Date: 2020/5/19 10:15
 * @Description: 暂无描述
 */
@Component
public class AuthenticationValidateCodeDetailsSource implements AuthenticationDetailsSource<HttpServletRequest, WebAuthenticationDetails> {
    private AuthenticationParameter authenticationParameter;

    public AuthenticationValidateCodeDetailsSource(AuthenticationParameter authenticationParameter) {
        this.authenticationParameter = authenticationParameter;
    }

    @Override
    public WebAuthenticationDetails buildDetails(HttpServletRequest request) {
        return new AuthenticationValidateCodeDetails(request, authenticationParameter);
    }
}
